package com.hx.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;

import com.hx.pojo.CosDep;
import com.hx.pojo.DepRepository;
import com.hx.pojo.DepotInfo;
@Component
public class DepService {
	@Autowired
	private DepRepository dr;
	
	public List<CosDep> getCosDep(){
		return dr.getDep();
	}
	
	public Page<CosDep> getPage(int pageNow,int pageSize) {
		Pageable pageable=new PageRequest(pageNow, pageSize);
		return dr.getDep(pageable);
	}
	
	public void deleteId(int id){
		dr.delete(id);
	}
	
	public void save(DepotInfo d){
		dr.save(d);
	}
}
